
let state = null;
let setter = () => {};

function useState(initialState) {
  state = initialState ?? null;
  setter = (newState) => {
    state = newState;
    // 触发渲染 (简化)
    console.log('state:', state);
  }
  return [state, setter];
}

const [count, setCount] = useState(0);
setCount(1); // 触发渲染